@quesmed/types 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/models/OsceMarksheet.d.ts +1 -0
- package/models/OsceStation.d.ts +15 -6
- package/models/OsceStation.js +37 -5
- package/models/Picture.d.ts +14 -0
- package/models/Picture.js +4 -0
- package/models/Topic.d.ts +2 -1
- package/models/Topic.js +1 -0
- package/package.json +1 -1
- package/utils/lightgallery.d.ts +6 -0
- package/utils/lightgallery.js +66 -0
package/models/OsceStation.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { IConcept } from './Concept';
|
|
2
1
|
import { EDifficultyType } from './Difficulty';
|
|
2
|
+
import { IOsceActorPicture, IOsceCandidatePicture, IOsceExaminerPicture, IOsceWalkthroughPicture } from './Picture';
|
|
3
|
+
import { ITopic } from './Topic';
|
|
3
4
|
import { Id } from './Type';
|
|
4
5
|
export interface IOsceType {
|
|
5
6
|
id: Id;
|
|
@@ -7,6 +8,7 @@ export interface IOsceType {
|
|
|
7
8
|
}
|
|
8
9
|
export interface IOsceStationMark {
|
|
9
10
|
id: Id;
|
|
11
|
+
index: number;
|
|
10
12
|
osceStationId: Id;
|
|
11
13
|
header: string;
|
|
12
14
|
name: string;
|
|
@@ -14,10 +16,10 @@ export interface IOsceStationMark {
|
|
|
14
16
|
export declare enum EOsceType {
|
|
15
17
|
HISTORY_TAKING = 1,
|
|
16
18
|
COMMUNICATION_SKILLS = 2,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
EXAMINATION = 3,
|
|
20
|
+
PROCEDURE = 4,
|
|
21
|
+
INTERPRETATION = 5,
|
|
22
|
+
ABCDE = 6
|
|
21
23
|
}
|
|
22
24
|
export interface IOsceStation {
|
|
23
25
|
id: Id;
|
|
@@ -32,9 +34,16 @@ export interface IOsceStation {
|
|
|
32
34
|
actorBrief: string;
|
|
33
35
|
explanation: string;
|
|
34
36
|
marks: IOsceStationMark[];
|
|
35
|
-
|
|
37
|
+
topics?: ITopic[];
|
|
38
|
+
candidatePictures?: IOsceCandidatePicture[];
|
|
39
|
+
actorPictures?: IOsceActorPicture[];
|
|
40
|
+
examinerPictures?: IOsceExaminerPicture[];
|
|
41
|
+
walkthroughPictures?: IOsceWalkthroughPicture[];
|
|
36
42
|
}
|
|
37
43
|
export interface IOsceStationItem extends IOsceStation {
|
|
38
44
|
attempted: boolean;
|
|
39
45
|
score: number;
|
|
40
46
|
}
|
|
47
|
+
export declare const OSCE_GLOBAL_RATING: {
|
|
48
|
+
[key: number]: string;
|
|
49
|
+
};
|
package/models/OsceStation.js
CHANGED
|
@@ -1,12 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EOsceType = void 0;
|
|
3
|
+
exports.OSCE_GLOBAL_RATING = exports.EOsceType = void 0;
|
|
4
4
|
var EOsceType;
|
|
5
5
|
(function (EOsceType) {
|
|
6
6
|
EOsceType[EOsceType["HISTORY_TAKING"] = 1] = "HISTORY_TAKING";
|
|
7
7
|
EOsceType[EOsceType["COMMUNICATION_SKILLS"] = 2] = "COMMUNICATION_SKILLS";
|
|
8
|
-
EOsceType[EOsceType["
|
|
9
|
-
EOsceType[EOsceType["
|
|
10
|
-
EOsceType[EOsceType["
|
|
11
|
-
EOsceType[EOsceType["
|
|
8
|
+
EOsceType[EOsceType["EXAMINATION"] = 3] = "EXAMINATION";
|
|
9
|
+
EOsceType[EOsceType["PROCEDURE"] = 4] = "PROCEDURE";
|
|
10
|
+
EOsceType[EOsceType["INTERPRETATION"] = 5] = "INTERPRETATION";
|
|
11
|
+
EOsceType[EOsceType["ABCDE"] = 6] = "ABCDE";
|
|
12
12
|
})(EOsceType = exports.EOsceType || (exports.EOsceType = {}));
|
|
13
|
+
exports.OSCE_GLOBAL_RATING = {
|
|
14
|
+
[EOsceType.ABCDE]: `- Fail - The candidate did not perform large parts of the scenario to the required standard
|
|
15
|
+
- Borderline - It is not clear whether the candidate demonstrated acceptable performance: either the whole task was performed slightly below passing level or there were some key errors or omissions
|
|
16
|
+
- Pass - The task was performed to an acceptable level. There may have been some minor errors or omissions.
|
|
17
|
+
- Good - The performance of the candidate was good in most areas. Technical and non-technical aspects of the task were performed equally well.
|
|
18
|
+
- Excellent - The candidate performed to a high standard throughout. They were fluent in all aspects of the task and displayed confidence, professionalism, and empathy.`,
|
|
19
|
+
[EOsceType.COMMUNICATION_SKILLS]: `- Fail - The candidate did not perform large parts of the scenario to the required standard
|
|
20
|
+
- Borderline - It is not clear whether the candidate demonstrated acceptable performance: either the whole task was performed slightly below passing level or there were some key errors or omissions
|
|
21
|
+
- Pass - The task was performed to an acceptable level. There may have been some minor errors or omissions.
|
|
22
|
+
- Good - The performance of the candidate was good in most areas. Technical and non-technical aspects of the task were performed equally well.
|
|
23
|
+
- Excellent - The candidate performed to a high standard throughout. They were fluent in all aspects of the task and displayed confidence, professionalism, and empathy.`,
|
|
24
|
+
[EOsceType.EXAMINATION]: `- Fail - The candidate did not perform large parts of the scenario to the required standard
|
|
25
|
+
- Borderline - It is not clear whether the candidate demonstrated acceptable performance: either the whole task was performed slightly below passing level or there were some key errors or omissions
|
|
26
|
+
- Pass - The task was performed to an acceptable level. There may have been some minor errors or omissions.
|
|
27
|
+
- Good - The performance of the candidate was good in most areas. Technical and non-technical aspects of the task were performed equally well.
|
|
28
|
+
- Excellent - The candidate performed to a high standard throughout. They were fluent in all aspects of the task and displayed confidence, professionalism, and empathy.`,
|
|
29
|
+
[EOsceType.HISTORY_TAKING]: `- Fail - The candidate did not perform large parts of the scenario to the required standard.
|
|
30
|
+
- Borderline - It is not clear whether the candidate demonstrated acceptable performance: either the whole history was performed slightly below passing level or there were some key errors or omissions. The differentials have some important omissions.
|
|
31
|
+
- Pass - The history was performed to an acceptable level. There may have been some minor errors or omissions. The differentials were sensible.
|
|
32
|
+
- Good - The performance of the candidate was good in most areas. All aspects of the task were performed equally well. The differentials were thorough and well-reasoned.
|
|
33
|
+
- Excellent - The candidate performed to a high standard throughout. They were fluent in all aspects of the history and summary and displayed confidence, professionalism, and empathy.`,
|
|
34
|
+
[EOsceType.INTERPRETATION]: `- Fail - The candidate did not perform large parts of the scenario to the required standard
|
|
35
|
+
- Borderline - It is not clear whether the candidate demonstrated acceptable performance: either the whole task was performed slightly below passing level or there were some key errors or omissions
|
|
36
|
+
- Pass - The task was performed to an acceptable level. There may have been some minor errors or omissions.
|
|
37
|
+
- Good - The performance of the candidate was good in most areas. Technical and non-technical aspects of the task were performed equally well.
|
|
38
|
+
- Excellent - The candidate performed to a high standard throughout. They were fluent in all aspects of the task and displayed confidence, professionalism, and empathy.`,
|
|
39
|
+
[EOsceType.PROCEDURE]: `- Fail - The candidate did not perform large parts of the scenario to the required standard.
|
|
40
|
+
- Borderline - It is not clear whether the candidate demonstrated acceptable performance: either the whole task was performed slightly below passing level or there were some key errors or omissions.
|
|
41
|
+
- Pass - The task was performed to an acceptable level. There may have been some minor errors or omissions.
|
|
42
|
+
- Good - The performance of the candidate was good in most areas. Technical and non-technical aspects of the task were performed equally well.
|
|
43
|
+
- Excellent - The candidate performed to a high standard throughout. They were fluent in all aspects of the task and displayed confidence, professionalism, and empathy.`,
|
|
44
|
+
};
|
package/models/Picture.d.ts
CHANGED
|
@@ -31,3 +31,17 @@ export interface IChapterPicture {
|
|
|
31
31
|
chapterId: Id;
|
|
32
32
|
picture: IPicture;
|
|
33
33
|
}
|
|
34
|
+
export interface IOscePicture {
|
|
35
|
+
id: Id;
|
|
36
|
+
osceStationId: Id;
|
|
37
|
+
pictureId: Id;
|
|
38
|
+
picture: IPicture;
|
|
39
|
+
}
|
|
40
|
+
export interface IOsceCandidatePicture extends IOscePicture {
|
|
41
|
+
}
|
|
42
|
+
export interface IOsceActorPicture extends IOscePicture {
|
|
43
|
+
}
|
|
44
|
+
export interface IOsceExaminerPicture extends IOscePicture {
|
|
45
|
+
}
|
|
46
|
+
export interface IOsceWalkthroughPicture extends IOscePicture {
|
|
47
|
+
}
|
package/models/Picture.js
CHANGED
package/models/Topic.d.ts
CHANGED
package/models/Topic.js
CHANGED
|
@@ -9,4 +9,5 @@ var ETopicType;
|
|
|
9
9
|
ETopicType[ETopicType["ANATOMY"] = 3] = "ANATOMY";
|
|
10
10
|
ETopicType[ETopicType["DATA_INTERPRETATION"] = 4] = "DATA_INTERPRETATION";
|
|
11
11
|
ETopicType[ETopicType["PSA"] = 5] = "PSA";
|
|
12
|
+
ETopicType[ETopicType["OSCE"] = 6] = "OSCE";
|
|
12
13
|
})(ETopicType = exports.ETopicType || (exports.ETopicType = {}));
|
package/package.json
CHANGED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.lightgalleryOsceResolve = void 0;
|
|
13
|
+
const lightgalleryRegex = /\[lightgallery\]/;
|
|
14
|
+
const lightgalleryOsceResolve = (osceMarksheet, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
if (!osceMarksheet.osceStation) {
|
|
16
|
+
throw new Error('OsceStation not found on OsceMarksheet');
|
|
17
|
+
}
|
|
18
|
+
const station = osceMarksheet.osceStation;
|
|
19
|
+
if (station.candidatePictures && station.candidatePictures.length > 0) {
|
|
20
|
+
osceMarksheet.osceStation.candidateBrief = yield lightgalleryMutation(osceMarksheet.osceStation.candidateBrief, station.candidatePictures, cache);
|
|
21
|
+
}
|
|
22
|
+
if (station.actorPictures && station.actorPictures.length > 0) {
|
|
23
|
+
osceMarksheet.osceStation.actorBrief = yield lightgalleryMutation(osceMarksheet.osceStation.actorBrief, station.actorPictures, cache);
|
|
24
|
+
}
|
|
25
|
+
if (station.examinerPictures && station.examinerPictures.length > 0) {
|
|
26
|
+
osceMarksheet.osceStation.examinerBrief = yield lightgalleryMutation(osceMarksheet.osceStation.examinerBrief, station.examinerPictures, cache);
|
|
27
|
+
}
|
|
28
|
+
if (station.walkthroughPictures && station.walkthroughPictures.length > 0) {
|
|
29
|
+
osceMarksheet.osceStation.explanation = yield lightgalleryMutation(osceMarksheet.osceStation.explanation, station.walkthroughPictures, cache);
|
|
30
|
+
}
|
|
31
|
+
return osceMarksheet;
|
|
32
|
+
});
|
|
33
|
+
exports.lightgalleryOsceResolve = lightgalleryOsceResolve;
|
|
34
|
+
const lightgalleryMutation = (text, pictures, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
+
var _a;
|
|
36
|
+
if (pictures.length === 0) {
|
|
37
|
+
return text;
|
|
38
|
+
}
|
|
39
|
+
const picturesHTML = [];
|
|
40
|
+
for (const { picture } of pictures) {
|
|
41
|
+
const pic = picture.path;
|
|
42
|
+
const uri = `https://app.quesmed.com/${pic}`;
|
|
43
|
+
let file = '';
|
|
44
|
+
if (cache) {
|
|
45
|
+
try {
|
|
46
|
+
const localPath = yield cache.CacheManager.get(uri, {}).getPath();
|
|
47
|
+
if (localPath) {
|
|
48
|
+
file = cache.Platform.OS === 'ios' ? localPath.replace('file://', '') : localPath;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
console.error(e);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (((_a = picture.caption) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
56
|
+
picturesHTML.push(``);
|
|
57
|
+
}
|
|
58
|
+
picturesHTML.push(``);
|
|
59
|
+
}
|
|
60
|
+
if (lightgalleryRegex.test(text)) {
|
|
61
|
+
return text.replace(lightgalleryRegex, picturesHTML[0]);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return text + '\n\n' + picturesHTML[0] + '\n';
|
|
65
|
+
}
|
|
66
|
+
});
|